package cn.nami.web.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class DateUtil
{
	public static final String COMMON_FORMAT = "yyyy-MM-dd HH:mm:ss";

	private static final SimpleDateFormat dateFormat = new SimpleDateFormat(COMMON_FORMAT);
	
	private DateUtil(){};
	
	public static String formatDate(Date date)
	{
		if(date == null)
		{
			return null;
		}
		dateFormat.setTimeZone(TimeZone.getTimeZone("GMT+8"));
		return dateFormat.format(date);
	}
	
	public static void main(String[] args)
	{
		System.out.println(formatDate(new Date()));
	}
}